package com;

import java.lang.reflect.Field;

/**
 * Created by yangsp1 on 16/3/29.
 */
public class BeanUtil {

    public static Object getFieldValue(Object bean,String fieldName) throws NoSuchFieldException, IllegalAccessException {
        Field field = bean.getClass().getDeclaredField(fieldName);
        field.setAccessible(true);
        return field.get(bean);
    }

    public static Class[] getClasses(Object bean){
        Class[] clazzs = bean.getClass().getClasses();
        return clazzs;
    }
}
